{extend name="layout/layout" /}
<!--请在下方写此页面body相关内容-->
{block name="container"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post">
        <div id="tab-system" class="HuiTab">
            <div class="tabBar cl">
                <span>基本设置</span>
                <span>安全设置</span>
                <span>微信小程序</span>
            </div>
            <div class="tabCon">
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">网站名称：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="site_name"  value="{$config.site_name}" class="input-text" name="site_name">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">网站跟地址：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="site_url"  value="{$config.site_url}" class="input-text" name="site_url">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">网站关键词：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="site_keyword"  value="{$config.site_keyword}" class="input-text" name="site_keyword">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">网站版本：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="site_version"  value="{$config.site_version}" class="input-text" name="site_version">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">描述：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="description"  value="{$config.description}" class="input-text" name="description">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">底部版权：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="website-copyright"  value="{$config.copyright}" class="input-text" name="copyright">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">备案号：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" id="website-icp" placeholder="京ICP备00000000号" value="{$config.trackcode}" class="input-text" name="trackcode">
                    </div>
                </div>
            </div>

            <div class="tabCon">
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">允许访问后台的IP列表：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <textarea class="textarea" name="allow_ip" id="">{$config.allow_ip}</textarea>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">后台登录失败最大次数：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$config.login_fail_times}" id="" name="login_fail_times" >
                    </div>
                </div>
            </div>

            <div class="tabCon">
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">AppID：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$config.app_id}" id="" name="app_id" >
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">AppSecret：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$config.app_secret}" id="" name="app_secret" >
                    </div>
                </div>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
            </div>
        </div>
    </form>
</div>
{/block}
<!--请在上方写此页面body相关内容-->

<!--请在下方写此页面业务相关的脚本-->
{block name="js"}
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    $("#tab-system").Huitab({ tabBar:".tabBar span", tabCon: ".tabCon", className: "current", tabEvent: "click", index: "0" });

    $("#form").validate({
        rules:{

        },
        submitHandler:function(form){
            var options = {
                beforeSubmit: function () {
                    load = layer.load();
                },
                success: function(obj){
                    if(obj.code !== 0){
                        layer.msg(obj.msg,{ icon:5, time:2000 });
                    } else {
                        layer.msg(obj.msg, { icon: 1, time: 1000});
                    }
                    layer.close(load);
                }
            };
            $(form).ajaxSubmit(options);
        }
    });
});
</script>
{/block}
<!--/请在上方写此页面业务相关的脚本-->
